﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization.Json;
using System.IO;

namespace Tomato.Serialization
{
    public class JsonSerializer : Serializer
    {
        public override void Serialize(Stream stream, object obj)
        {
            if (obj != null)
            {
                DataContractJsonSerializer s = new DataContractJsonSerializer(obj.GetType());
                s.WriteObject(stream, obj);
            }
        }
    }
}
